(function() {
    let curIndex = location.search.substring(1).split('=')[1];
    console.log(curIndex);
    fetch('http://chst.vip:1234/api/getmoneyctrlproduct?productid=' + curIndex).then(body => body.json()).then(res => {
        let result = res.result;
        console.log(result);
        let nrStr = '';
        result.forEach(item => {
            console.log(item)
          console.log(item.productComment)
            let regExp = /([^"]+)/g
                let url = item.productImg2.match(regExp);
                let i=url[1].split(';')
                console.log(i)
                I=i[1].replace('imgurl=','')
                console.log(I)
            nrStr += `

            <h2>${item.productName}</h2>
            <span>上新时间: ${item.productTime}</span>
            <span>来源: ${item.productTips}</span>
            
            <div class="content">
              
                
                <div class="info">
               
                  
                </div>
                <div class="img">
             
               
                <img src='${I}' alt='url[3]'/>
               
                ${item.productInfo}
                ${item.productInfo1}
    
                </div>
            </div>
           <div class=bigImg> <img src='${I}' alt='url[3]'/></div>
            <div class="city">
            ${item.productCity}
            </div>
            <div class="buy">
                <button id="shopping">前往购买</button>
                <img src="../images/ewm.png" alt="" class="ewm">
            </div>
            ${item.productComment}
            `
        });
        $('main').html(nrStr)
    })
})()